package com.endpoint.home.controller;

import com.endpoint.common.utils.ResultBean;
import com.endpoint.home.service.IHomeService;
import com.endpoint.home.to.BookTo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "首页相关接口")
@RestController
@RequestMapping("/home")
public class HomeController {
    @Autowired
    private IHomeService homeService;
    @ApiOperation(value = "小说更新榜查询接口")
    @GetMapping("/updateRankList")
    public ResultBean<List<BookTo>> updateRankList(){
       List<BookTo> list = homeService.updateRankList();
        return ResultBean.ok(list);
    }
}